package algotithms.easy;

/*
 * 476
 */
public class NumberComplement {

	public static void main(String[] args) {
		
		System.out.println(findComplement(5));
	}
	
	public static int findComplement(int num) {
		int flag = (Integer.highestOneBit(num) << 1) - 1;
		return num^flag;
	}
	
}
